#include "my_heap.h"
#include <queue>

int main()
{

    /* 自己实现的堆的操作 */
    std::vector<int> create_vec = {4, 3, 2, 5, 6, 7, 8, 12};
    my_heap<int> min_top_heap(create_vec, false);
    std::cout << "建立小顶堆:\n";
    min_top_heap.level_traversal();
    std::cout << "插入节点9\n";
    min_top_heap.insert_node(9);
    min_top_heap.level_traversal();
    for (int i = 0; i < 6; ++i)
        min_top_heap.pop_top();
    min_top_heap.level_traversal();

    std::cout << "=========================\n";

    my_heap<int> max_top_heap(create_vec);
    std::cout << "建立大顶堆:\n";
    max_top_heap.level_traversal();
    std::cout << "插入节点9\n";
    max_top_heap.insert_node(9);
    max_top_heap.level_traversal();
    for (int i = 0; i < 6; ++i)
        max_top_heap.pop_top();
    max_top_heap.level_traversal();
    return 0;
}